package ofxdownloader;

/**
 * This class represents an OFX request object for retrieving a list
 * of accounts when given the appropriate sign on information
 * @author Alex Spurling
 *
 */
public class AccountListRequest implements OFXRequest {

	private String request;
	
	public AccountListRequest(SignOnInfo signOnInfo) {
		String requestID = OFXRequestBuilder.generateID();
		String header = OFXRequestBuilder.getOFXHeader(null, requestID);
		String signOnRequest = OFXRequestBuilder.getSignOnRequest(signOnInfo.getUserID(), signOnInfo.getUserPass());
		String accountListRequest = OFXRequestBuilder.getAccountListRequest();
		
		request = OFXRequestBuilder.getCompleteRequest(header, signOnRequest + accountListRequest);
	}
	
	public String toString() {
		return request;
	}

}
